"""
# -*- coding: utf-8 -*-
# @Time    : 2023/6/12 19:53
# @Author  : 王摇摆
# @FileName: Visual_Network.py
# @Software: PyCharm
# @Blog    ：https://blog.csdn.net/weixin_44943389?type=blog
"""
import os
import warnings

# warnings.filterwarnings('ignore')
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'  # 设置TensorFlow日志级别为"ERROR"
from keras import Sequential
from keras.layers import Dense
from keras.utils import plot_model
import matplotlib.pyplot as plt

model = Sequential()
model.add(Dense(3, input_shape=(4,), activation="sigmoid"))
model.add(Dense(3, activation="sigmoid"))
model.add(Dense(3, activation="softmax"))

plot_model(model, to_file='network.png', show_shapes=True)

img = plt.imread('network.png')
plt.figure(figsize=(10, 10))
plt.imshow(img)
plt.axis('off')
plt.show()
